import service from "@/utils/request";

export const register = async ({userName:name, mobile, password, auth})=>{
    return await service({
        url:"/register",
        method:"POST",
        data:{
            name,
            mobile,
            password,
            auth
        },
        headers:{
            isToken:false
        }
    })
}

export const sendAuth = async (auth)=>{
    return await service({
        url:"/sendAuth",
        method:"POST",
        data:{
            auth
        },
        headers:{
            isToken:false
        }
    })
}

export const login = async function ({account:name}) {
    return await service({
        url:"/login",
        method:"POST",
        data:{
            name
        },
        header:{
            isToken:false
        }
    })
}

export const getUserByToken = async ()=>{
    return service({
        url:"/getUserInfoByToken",
        method:"POST",
        data:{

        },
        headers:{
            isToken:true
        }
    })
}
